# coding=utf-8
#!/usr/bin/python3
#@Time:2021/2/25 10:45 上午
#@Author:wangyun
#@File:main.py
from celery import Celery
import os

if not os.getenv('DJANGO_SETTINGS_MODULE'):
    os.environ['DJANGO_SETTINGS_MODULE'] ='nxh_mall.settings.dev'

#创建实例
celery_app = Celery('nxh')
#创建中间人加载配置
celery_app.config_from_object('celery_tasks.config')
#注册任务 识别任务
celery_app.autodiscover_tasks(['celery_tasks.sms','celery_tasks.email'])

if __name__ == '__main__':
    pass

# 启动celery服务器
# cd 工程目录
# celery -A celery_tasks.main worker -l info